define(["shareNode", "screenAdopt"], function (shareNode, screenAdopt) {
    /*所有分享数组对象*/
    let shareArr = function () {
        this.shareNode = new shareNode()
        this.playNode = [document.querySelectorAll(".cont")[0], document.querySelectorAll(".cont")[1], document.querySelectorAll(".cont")[2]]
    }
    shareArr.prototype.setPlayNode = function () {
        this.playNode = [document.querySelectorAll(".cont")[0],document.querySelectorAll(".cont")[1], document.querySelectorAll(".cont")[2]]
    }
    shareArr.prototype.getPlayNode = function () {
        return this.playNode
    }
    shareArr.prototype.showAllNode = function (arrayData, leng, page, addShare) {
        let arr = this.playNode
        if (this.shareNode.setWidthOfPare)
            this.shareNode.setWidthOfPare(parseInt(this.getPlayNode()[0].style.width)) //父组件给子组件传递长度,这个为cont的内容宽度
        for (let j = 0; j < leng; j++) {
            arr[j].style.display = "inline-block"
        }
        for (let j = leng; j < arr.length; j++) {
            arr[j].style.display = "none"
        }
        if (arrayData && (arrayData.length === 1) && leng !== 1) {
            return this.showAllNode(arrayData, 1, page, addShare)
        }

        for (let z = 0; z < arrayData.length; z++) {
            let div = this.shareNode.getOneNode(arrayData[z])
            let tem = z % leng
            for (let m = 0; m < leng; m++) {
                if (z % leng === m) {
                    arr[m].appendChild(div)
                }
            }
        }
    };
    shareArr.prototype.adjustScreen = function (object, leng) {
        let arr = this.playNode
        if (this.shareNode.setWidthOfPare)
            this.shareNode.setWidthOfPare(parseInt(this.getPlayNode()[0].style.width))  // 父组件给子组件传递长度,这个为cont的内容宽度
        for (let j = 0; j < leng; j++) {
            arr[j].style.display = "inline-block"
        }
        for (let j = leng; j < arr.length; j++) {
            arr[j].style.display = "none"
        }
        if (object && object.arrayAllChildrenNode.length === 1 && leng !== 1) {
            return this.adjustScreen(object, 1)
        }
        for (let z = 0; z < object.arrayAllChildrenNode.length; z++) {
            let div = object.arrayAllChildrenNode[z]
            let tem = z % leng
            for (let m = 0; m < leng; m++) {
                if (z % leng === m) {
                    arr[m].appendChild(div)
                }
            }
        }
    }
    return shareArr
})